Reference for Wiring version 0027+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name |
setClockDivider() |
Examples |
// starts SPI default: SPI_MASTER, MSBFIRST, SPI_MODE3, SPI_CLOCK_DIV4
SPI.begin();
// starts SPI with specific parameters
SPI.begin(SPI_MASTER, LSBFIRST, SPI_MODE3, SPI_CLOCK_DIV4); |
Description |
The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard named by Motorola that operates in full duplex mode. Devices communicate in a master/slave mode where the master device initiates the data frame. Multiple slave devices are allowed with individual slave select (chip select) lines using a pin for each device. The setClockDivider() method the speed clock rate divider used for the communication, clockDivider is a fraction of the main CPU clock speed: SPI_CLOCK_DIV4 (1/4th of the CPU speed), SPI_CLOCK_DIV16 (1/16th of the CPU speed), SPI_CLOCK_DIV64 (1/64th of the CPU speed), SPI_CLOCK_DIV128 (1/128th of the CPU speed), SPI_CLOCK_DIV2 (1/2 of the CPU speed), SPI_CLOCK_DIV8 (1/8th of the CPU speed), SPI_CLOCK_DIV32 (1/32th of the CPU speed) or SPI_CLOCK_DIV64 (1/64th of the CPU speed). |
Syntax |
SPI.setClockDivider(clockDivider) |
Parameters |
clockDivider |
constant: SPI_CLOCK_DIV4, SPI_CLOCK_DIV16, SPI_CLOCK_DIV64, SPI_CLOCK_DIV128, SPI_CLOCK_DIV2, SPI_CLOCK_DIV8, SPI_CLOCK_DIV32 or SPI_CLOCK_DIV64 |
|
Returns |
None |
Usage |
Application |
Updated on September 19, 2010 09:38:44pm PDT